In the prior art, when user equipment is to access a wireless network, for example, when the user equipment is to be connected to a WiFi (wireless fidelity) network, a selected target wireless access point is generally accessed first based on a connection password of wireless access points around a device searched by the user equipment, and then based on a connection password of a target wireless access point manually input by a user, and if the user forgets or does not know the connection password of the target wireless access point, the WiFi network corresponding to the target wireless access point may not be accessed.